import { request } from '@/utils/request.js'

/**
 * 销售提成账单 API JS
 */

export default {

  /**
   * 获取销售提成账单分页列表
   * @returns
   */
  getList (params = {}) {
    return request({
      url: 'finance/bonusPercentageBill/index',
      method: 'get',
      params
    })
  },

  /**
   * 添加销售提成账单
   * @returns
   */
  save (data = {}) {
    return request({
      url: 'finance/bonusPercentageBill/save',
      method: 'post',
      data
    })
  },

  /**
   * 更新销售提成账单数据
   * @returns
   */
  update (id, data = {}) {
    return request({
      url: 'finance/bonusPercentageBill/update/' + id,
      method: 'put',
      data
    })
  },

  /**
   * 读取销售提成账单
   * @returns
   */
  read (id) {
    return request({
      url: 'finance/bonusPercentageBill/read/' + id,
      method: 'get'
    })
  },

  /**
   * 将销售提成账单删除，有软删除则移动到回收站
   * @returns
   */
  deletes (data) {
    return request({
      url: 'finance/bonusPercentageBill/delete',
      method: 'delete',
      data
    })
  },

  /**
   * 从回收站获取销售提成账单数据列表
   * @returns
   */
  getRecycleList (params = {}) {
    return request({
      url: 'finance/bonusPercentageBill/recycle',
      method: 'get',
      params
    })
  },

  /**
   * 恢复销售提成账单数据
   * @returns
   */
  recoverys (data) {
    return request({
      url: 'finance/bonusPercentageBill/recovery',
      method: 'put',
      data
    })
  },

  /**
   * 真实删除销售提成账单
   * @returns
   */
  realDeletes (data) {
    return request({
      url: 'finance/bonusPercentageBill/realDelete',
      method: 'delete',
      data
    })
  },
  /**
   * 获取核销记录
   * @returns
   */
  getStateList (data = {}) {
    return request({
      url: 'finance/statementFee/remote',
      method: 'post',
      data
    })
  },
  /**
   * 反核销
   * @returns
   */
  writeOffRefuse (data = {}) {
    return request({
      url: 'finance/bonusPercentageBill/writeOff/refuse',
      method: 'post',
      data
    })
  },
  /**
   * 核销
   * @returns
   */
  writeOffPass (data = {}) {
    return request({
      url: 'finance/bonusPercentageBill/writeOff/pass',
      method: 'post',
      data
    })
  },
  /**
   * 审计
   * @returns
   */
  auditPass (data = {}) {
    return request({
      url: 'finance/bonusPercentageBill/audit/pass',
      method: 'post',
      data
    })
  },
  /**
   * 反审计
   * @returns
   */
  auditRefuse (data = {}) {
    return request({
      url: 'finance/bonusPercentageBill/audit/refuse',
      method: 'post',
      data
    })
  },
    /**
   * 获取流水 按客户分组
   * @returns
   */
  getFeeList (params = {}) {
    return request({
      url: 'finance/bonus/feeList',
      method: 'get',
      params
    })
  },
}